home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
util
/
sys
/
AllocP.lha
/
AllocP
/
AllocP.readme
< prev
next >
Wrap
Text File
|
1997-08-16
|
2KB
|
61 lines
Short: AllocP - BetterAlloc (AllocMem/AllocVec patch) V1.2
Type: util/sys
Uploader: Andreas_Kleinert@t-online.de
Author: Andreas_Kleinert@t-online.de
Sometimes programs fail with a "not enough memory" error,
but after calling "avail flush" the same operation does
succeed without problems.
Obviously AllocMem/AllocVec does not force such a "flush"
operation *and* tries to allocate memory again. Why ?
This patch does ensure, that AllocMem/AllocVec won't
fail unless there's really no memory available, even
by flushing. This means:
- less "out of memory" failures
- less "bad behaviour" of bad programs, which don't
check results of AllocMem/AllocVec
- no more need to call "avail flush" by hand
from the shell
- thus no more "retry" operations after "avail flush"
- no more unused libraries/devices consuming memory
when it is already low
Additionally, it makes AllocVec aligning its allocations to
longword boundaries - at the *end* . As you know, the Alloc#?
functions always return memory starting at longword-aligned
boundaries. But since Exec just keeps a list of the free
memory and not the allocated memory, this could mean, that
the number of 1, 2 or 3 byte chunks (which would never be
used again unless their predecessors or successors are
delocated again) could increase drastically. There's no
way to bypass this for AllocMem, but for AllocVec the
requested allocation now automatically will include these
"gaps", with the following side effects:
- less entries in the free memory list
- less memory fragmentation
- less administration overhead
- a little bit more safety with programs, which
usually overwrite AllocVec'ed buffers by 1, 2 or
3 bytes and otherwise might have produced
MungWall hits ;-)
- the latter may also be true for some cases where
programs don't align their Read/WritePixeLine8()
buffers ;-)
Note: Needs V37+ and 68020.
To be put into s:user-startup, but
runable anywhere else, too.
You use this patch at your own risk.
No guarantee for anything.
Source code included.
---
All mentioned trademarks are subject to their owners.